<?php if (count($product_promotion) > 0) :?>
<div id="featured_products">
    <h4>Sản phẩm đang khuyến mại</h4>
    <div class="block_content">
        <ul>
            <?php foreach($product_promotion as $key => $value) :?>
            <li class="ajax_block_product">
                <h5><a class="product_link" href="<?php echo base_url('san-pham/'.$value['product_id'].'_'.url_friendly($value['title']));?>.html" title="<?php echo $value['title'];?>"><?php echo $value['title'];?></a></h5>
                <a class="product_image" href="<?php echo base_url('san-pham/'.$value['product_id'].'_'.url_friendly($value['title']));?>.html" title="<?php echo $value['title'];?>">
                    <img width="170" height="170" onerror="ImgError(this);" src="<?php echo render_image('/uploads/product/'.$value['product_id'].'/'.md5($value['product_id']).'.jpg', 170, 170, '1.1');?>" alt="<?php echo $value['title'];?>" />
                </a>
                <div>
                    <span class="price">
                        <?php if ($value['price_new'] < $value['price_old']) :?>
                        <span style="text-decoration: line-through; font-size: 16px; font-weight: bold;"><?php echo currency_format($value['price_old']); ?> VND</span><br />
                        <span style="font-size: 16px; font-weight: bold; color: red;"><?php echo currency_format($value['price_new']); ?> VND</span>
                        <?php endif; ?>
                    </span>
                    <a class="exclusive ajax_add_to_cart_button" rel="ajax_id_product_1" href="#" title="Add to cart">Thêm vào giỏ</a>
                    <a class="button" href="<?php echo base_url('san-pham/'.$value['product_id'].'_'.url_friendly($value['title']));?>.html" title="View">Xem</a>
                </div>
            </li>
            <?php endforeach;?>
        </ul>
    </div>
</div>
<?php endif;?>